<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./lib/jquery.js"></script>
    <script>
        $(function() {
                $('button').click(function() {
                    $.ajax({
                        url: 'http://127.0.0.1:3001/getdata2',
                        success: function(res) {
                            console.log('请求获取数据成功.res=' + res)
                        }
                    })
                })
            })
            // 点击按钮,发起请求, 这时候看看浏览器的前进和后退按钮有没有反应?
    </script>
</head>

<body>
    <button>点我发送请求</button>
</body>

</html>